package com.mayikt.service.days003;


/**
 * @ClassName Test001
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test001 {
    /**
     * 二进制文件内容存放那些内容：类的信息、局部变量表、方法信息、常量池
     *
     * @param args
     */
    public static void main(String[] args) {
//        System.out.println("mayikt");
//        String a1 = "a";// 字符串常量池
//        String a2 = "a";
//        String b = "b";

//        String ab1 = a1 + b; //StringBuilder
//        String ab3 = "a" + "b";
//        StringBuilder stringBuilder = new StringBuilder();
//        stringBuilder.append(a1);
//        stringBuilder.append(b);
//        stringBuilder.toString();
        //String ab2 = "ab";
//        System.out.println(a1 == a2);
//        System.out.println(ab3 == ab2);
        /**
         *== 引用地址
         *equals 内容值是否相等
         */
//        String a1 = "a";// 字符串常量池
        String a2 = new String("a");//new 对象字符放入堆内存空间中
        String a3 = a2.intern();//将该对象字符放入到字符常量池中
        System.out.println(a3 == "a");


    }
}
